Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Route Type in output of "antctl get bgproutes" #6803

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Atish-iaf
Copy link
Contributor

For #6794

@Atish-iaf Atish-iaf marked this pull request as ready for review November 11, 2024 10:20
@Atish-iaf Atish-iaf linked an issue Nov 12, 2024 that may be closed by this pull request
@rajnkamr rajnkamr added this to the Antrea v2.3 release milestone Nov 12, 2024
@rajnkamr rajnkamr added the area/transit/bgp Issues or PRs related to BGP support. label Nov 12, 2024
192.168.77.100/32
fec0::10:96:10:10/128
fec0::192:168:77:100/128
ROUTE TYPE
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would be more valuable IMO if in addition to the type, we had a reference to the K8s object

Copy link
Contributor

@rajnkamr rajnkamr Nov 14, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree , as there might be multiple resources for a crd, In future, for ex, we could support multiple egress ips,
Something like below will be more explanatory and respectively for other resources

ROUTE                    TYPE                  K8s OBJECT REFERENCE
172.18.0.3/32            EgressIP           Egress: egress-1

Comment on lines +85 to +87
LoadBalancerIP AdvertisedRouteType = "LoadBalancerIP"
ExternalIP AdvertisedRouteType = "ExternalIP"
ClusterIP AdvertisedRouteType = "ClusterIP"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: I would add a Service prefix to these

// routes stores all BGP routers advertised to BGP peers.
routes sets.Set[bgp.Route]
// routes stores all BGP routes advertised to BGP peers.
routes map[AdvertisedRouteType]sets.Set[bgp.Route]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The ability to provide a reference to the K8s object will require a different data structure here.
Personally, I would go with something like this:

type RouteMetadata struct {
        Type RouteType
        K8sObjRef string
}

routes map[bgp.Route]RouteMetadata
  1. you can easily get a set of desired routes with sets.KeySet(c.routes), requiring only minimal changes in reconcileBGPAdvertisements
  2. the handler will transform the data (as it already does) and filter routes if needed (based on type)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/transit/bgp Issues or PRs related to BGP support.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add route type in output of "antctl get bgproutes"
3 participants